package com.itheima.feign;

import com.itheima.entity.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import javax.servlet.http.HttpServletResponse;

@FeignClient("history")

@RequestMapping("history")
public interface HistoryFeign {

    @GetMapping("/findHistory")
    public Result findHistory(@RequestParam(value = "phone", required = false) String phone);

    @PostMapping("/addHistory")
    public Result addHistory(@RequestParam(value = "phone", required = false) String phone,
                             @RequestParam("productName") String productName,
                             HttpServletResponse response);

    @RequestMapping("/delByName")
    public Result delByName(@RequestParam(value = "phone", required = false) String phone, @RequestParam("productName") String productName);
}